/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022.
 * Description: irq bypass
 * Author: lilinjie8 <lilinjie8@huawei.com>
 * Create: 2022-01-24
 */

#ifndef HPVISOR_GIC_IRQBYPASS_H
#define HPVISOR_GIC_IRQBYPASS_H
#include <linux/of.h>
#include <linux/types.h>

#define RESERVED_IRQ_START 1020
#define RESERVED_IRQ_END 1023

extern int hpvisor_gic_save_guest_irq(u32 hwirq);
extern void hpvisor_gic_of_init(struct device_node *node, int nr_redist_regions);

static inline bool hpvisor_check_invalid_irqnr(u32 hwirq)
{
	return hwirq >= RESERVED_IRQ_START && hwirq <= RESERVED_IRQ_END;
}
#endif
